<template>
  <entity-view
    :operator-type="operatorType"
    :model="beanInfo"
    @submit="submit"
    :rules="rules"
    ref="form"
  >
    <div class="sub-content-flex">
      <form-item
        label="机构标识"
        v-model="beanInfo.instId"
        prop="instId"
      ></form-item>
      <form-item
        label="批次日期"
        v-model="beanInfo.batchDate"
        prop="batchDate"

      ></form-item>
      <form-item
        label="任务参数"
        v-model="beanInfo.taskParam"
        prop="taskParam"
      ></form-item>
      <form-item
        label="批次号"
        v-model="beanInfo.batchNo"
        prop="batchNo"
      ></form-item>
      <form-item
        label="原子任务号"
        v-model="beanInfo.atomTaskId"
        prop="atomTaskId"
      ></form-item>
      <form-item
        label="业务产品类型"
        v-model="beanInfo.bizProdType"
        prop="bizProdType"

        :options="bizProdTypeList"
      ></form-item>
      <form-item
        label="自动调账标志"
        v-model="beanInfo.autoAdjustFlag"
        prop="autoAdjustFlag"

        :options="autoAdjustFlagList"
      ></form-item>
      <form-item
        label="关键域"
        v-model="beanInfo.primaryKey"
        prop="primaryKey"
      ></form-item>
      <form-item
        label="原交易关键域"
        v-model="beanInfo.origKey"
        prop="origKey"
      ></form-item>
      <form-item
        label="关联交易关键域"
        v-model="beanInfo.relationKey"
        prop="relationKey"
      ></form-item>
      <form-item
        label="交易码"
        v-model="beanInfo.txnNum"
        prop="txnNum"
      ></form-item>
      <form-item
        label="差错类型"
        v-model="beanInfo.errType"
        prop="errType"
      ></form-item>
      <form-item
        label="差错原因码"
        v-model="beanInfo.errReasonCode"
        prop="errReasonCode"
      ></form-item>
      <form-item
        label="交易金额"
        v-model="beanInfo.transAmt"
        prop="transAmt"
      ></form-item>
      <form-item
        label="交易币种"
        v-model="beanInfo.transCcy"
        prop="transCcy"
      ></form-item>
      <form-item
        label="差错提交时间"
        v-model="beanInfo.errCommitTime"
        prop="errCommitTime"
      ></form-item>
      <form-item
        label="差错清算时间"
        v-model="beanInfo.errSettleTime"
        prop="errSettleTime"
      ></form-item>
      <form-item
        label="通道费用"
        v-model="beanInfo.payChannelFee"
        prop="payChannelFee"
      ></form-item>
      <form-item
        label="差错服务费"
        v-model="beanInfo.errServiceFee"
        prop="errServiceFee"
      ></form-item>
      <form-item
        label="原交易信息"
        v-model="beanInfo.origInfo"
        prop="origInfo"
      ></form-item>
      <form-item
        label="发起方备注"
        v-model="beanInfo.initiatorRemark"
        prop="initiatorRemark"

      ></form-item>
      <form-item
        label="受理方备注"
        v-model="beanInfo.acqRemark"
        prop="acqRemark"

      ></form-item>
      <form-item
        label="差错原因描述"
        v-model="beanInfo.errDesc"
        prop="errDesc"
      ></form-item>
      <form-item
        label="差错状态"
        v-model="beanInfo.errStatus"
        prop="errStatus"
      ></form-item>
      <form-item
        label="自动调账失败处理"
        v-model="beanInfo.autoAdjustFailDeal"
        prop="autoAdjustFailDeal"

        :options="autoAdjustFailDealList"
      ></form-item>
      <form-item
        label="调账状态"
        v-model="beanInfo.adjustStatus"
        prop="adjustStatus"

        :options="adjustStatusList"
      ></form-item>
      <form-item
        label="处理状态"
        v-model="beanInfo.acctStatus"
        prop="acctStatus"

        :options="acctStatusList"
      ></form-item>
      <form-item
        label="处理描述"
        v-model="beanInfo.acctStatus"
        prop="acctStatus"

      ></form-item>
      <form-item
        label="复核人代号"
        v-model="beanInfo.auditOprId"
        prop="auditOprId"
      ></form-item>
      <form-item
        label="审核状态"
        v-model="beanInfo.auditStatus"
        prop="auditStatus"

        :options="auditStatusList"
      ></form-item>
      <form-item
        label="审批拒绝原因"
        v-model="beanInfo.auditRefuseReason"
        prop="auditRefuseReason"
      ></form-item>
      </div>
  </entity-view>
</template>
<script>
import EntityView from "../../../../components/common/entityView/EntityView.vue";
import FormItem from "../../../../components/common/entityView/FormItem.vue";

export default {
  name: "ETppsErrTxnOperation",
  components: {
    EntityView,
    FormItem,
  },
  props: {
    query: Object,
  },
  data: function () {
    return {
      instId:"",
      modalTitle: "",
      operatorType: "view",
      modalVisible: true,
      bizProdTypeList: [
        {value:"01",name:"银联CUPS受理侧"},
        {value:"02",name:"微信支付"},
        {value:"03",name:"支付宝支付"},
        {value:"04",name:"分期"},
        {value:"05",name:"积分"},
        {value:"06",name:"银联小微二维码"},
        {value:"07",name:"网联受理侧"},
        {value:"08",name:"本行渠道业务"},
        {value:"11",name:"银联助农业务"},
        {value:"21",name:"银联线上支付"},

        {value:"22",name:"银联无卡快捷受理侧支付业务"},
        {value:"32",name:"银联无卡快捷代付业务"},
        {value:"33",name:"银联无卡快捷代收业务"},
        {value:"23",name:"银联全渠道_代付业务"},
        {value:"24",name:"银联全渠道_无跳转业务"},
        {value:"25",name:"银联全渠道_代收业务"},
        {value:"26",name:"深圳银联业务"},
        {value:"27",name:"厦门银联业务"},
        {value:"31",name:"银联二维码"},
        {value:"34",name:"银联网关支付"},

        {value:"40",name:"提现"},
        {value:"45",name:"营销"},
        {value:"90",name:"银联CUPS发卡侧"},
        {value:"91",name:"网联发卡侧"},
        {value:"92",name:"银联无卡快捷发卡侧"},
        {value:"41",name:"商户入账失败挂账"},
        {value:"42",name:"风险资金挂账"},
        {value:"43",name:"商户风险资金入账失败挂账"},
        {value:"46",name:"D0补入账"},
        {value:"47",name:"虚拟账户业务"},

        {value:"48",name:"人行大小额"},
        {value:"49",name:"超级网银"},
        {value:"44",name:"代理商分润"},
        {value:"50",name:"中金支付"},
        {value:"51",name:"D1垫资资金回填"},
        {value:"52",name:"连锁商户入账"},
        {value:"53",name:"内部户记账"},
        {value:"60",name:"本行渠道D0业务"},
        {value:"61",name:"银联CUPS受理侧D0业务"},
        {value:"62",name:"微信支付D0业务"},

        {value:"63",name:"支付宝支付D0业务"},
        {value:"64",name:"银联无卡快捷受理侧支付D0业务"},
        {value:"65",name:"银联全渠道_无跳转D0业务"},
        {value:"66",name:"银联网关支付D0业务"},
        {value:"67",name:"银联二维码D0业务"},

        {value:"*",name:"所有业务类型"},
      ],
      autoAdjustFlagList:[
        {value:"1",name:"自动调账"},
        {value:"2",name:"手工调账"},
      ],
       autoAdjustFailDealList:[
        {value:"0",name:"不处理"},
        {value:"1",name:"转成手工调账"},
      ],
      adjustStatusList:[
        {value:"00",name:"未调账"},
        {value:"01",name:"调账中"},
        {value:"02",name:"调账成功"},
        {value:"03",name:"调账失败"},
      ],
      acctStatusList:[
        {value:"00",name:"待记账"},
        {value:"01",name:"记账成功"},
        {value:"02",name:"记账失败"},
      ],
      auditStatusList:[
        {value:"00",name:"待提交审批"},
        {value:"11",name:"注销待审核"},
        {value:"22",name:"停用审核通过"},
        {value:"33",name:"启用审核拒绝"},
        {value:"01",name:"新增待审核"},
        {value:"12",name:"注销审核通过"},
        {value:"23",name:"停用审核拒绝"},
        {value:"02",name:"新增审核通过"},
        {value:"13",name:"注销审核拒绝"},
        {value:"03",name:"新增审核拒绝"},
        {value:"41",name:"修改待审核"},
        {value:"31",name:"启用待审核"},
        {value:"42",name:"修改审核通过"},
        {value:"21",name:"停用待审核"},
        {value:"32",name:"启用审核通过"},
        {value:"43",name:"修改审核拒绝"},
      ],
      beanInfo: {
        instId:"",
        batchDate:"",
        taskParam:"",
        batchNo:"",
        atomTaskId:"",
        bizProdType:"",
        autoAdjustFlag:"",
        primaryKey:"",
        origKey:"",
        relationKey:"",
        txnNum:"",
        errType:"",
        errReasonCode:"",
        transAmt:"",
        transCcy:"",
        errCommitTime:"",
        errSettleTime:"",
        payChannelFee:"",
        errServiceFee:"",
        origInfo:"",
        initiatorRemark:"",
        acqRemark:"",
        errDesc:"",
        errStatus:"",
        autoAdjustFailDeal:"",
        adjustStatus:"",
        acctStatus:"",
        respDesc:"",
        auditOprId:"",
        auditStatus:"",
        auditTime:"",
        auditRefuseReason:"",
      },
      rules: {
      },
      loading: false,
    };
  },

  methods: {
    async submit() {
      let res;
      switch (this.operatorType) {
        /*case "add":
          res = await this.add();
          break;*/
        /*case "edit":
          res = await this.edit();
          break;*/
        case "view":
          res = true;
          break;
        default:
          break;
      }
      return res;
    },
     /*async add() {
      try {
        const res = await this.$refs.form.validate();
        console.log(res);
        if (res) {
          const params = {...this.beanInfo,instId:this.instId,optFlag:'add'};
          const res = await this.$post("/admin/mcmp/bMchntLevelInfo/edit", params);
          if (res.status === 200) {
            this.$message.success("新增成功！");
            return true;
          } else {
            this.$message.error(res.data.message);
            return false;
          }
        }
      } catch (e) {
        console.error(e);
      }
    },*/
   /* async edit() {
      const res = await this.$refs.form.validate();
      if (res) {
        const params = {
          ...this.beanInfo,
          optFlag: "upd",
        };
        const res = await this.$post("/admin/mcmp/bMchntLevelInfo/edit", params);
        if (res.status === 200) {
          this.$message.success("保存成功！");
          return true;
        } else {
          this.$message.error(res.data.message);
          return false;
        }
      }
    },*/
    resetFields(instId) {
      this.instId = instId
      return this.$refs.form && this.$refs.form.resetFields();
    },
    setOperatorType(type) {
      this.operatorType = type;
    },
    setBeanInfo(beanInfo) {
      this.beanInfo = beanInfo;
      this.getOne();
    },
    async getOne() {
      try {
        const res = await this.$get("/admin/igas/eTppsErrTxn/edit", {
          primaryKey: this.beanInfo.primaryKey,
          instId: this.beanInfo.instId,
          optFlag:'view'
        });
        console.log(res+"     ***")
        this.beanInfo = res.data || {};
      } catch (e) {
        console.error(e);
      }
    },
  },
};
</script>

<style lang="less" scoped>
@import "../../../../../static/less/Common";
.subtitle {
  width: 100%;
  font-size: 18px;
  margin-bottom: 10px;
}
.sub-content-flex {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}
.sub-content-block {
  display: block;
  flex-wrap: wrap;
  width: 100%;
}
</style>
